getting a linkset handle from a link module descriptor

Hi all,

I searched the forum but could not find an answer to my question:

is there a way to get a linkset handle when I have a linkModuleDescriptor handle?

Thanks in advance.

Karl
kabr - Thu Mar 07 08:56:03 EST 2013

Re: getting a linkset handle from a link module descriptor
Mathias Mamsch - Thu Mar 07 13:17:31 EST 2013

Yes. From the LinkModuleDescriptor find the link module and open it. Iterate through the linksets until you find the one with the source and target of the LinkModuleDescriptor. Note that you might not always find one, since you can have a linkModuleDescriptor without a linkset existing for it, even without the modules existing.

So no there is no function, that will do it for you. Why would you even need that? Test if a linkset exists for a linkmodule descritor? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: getting a linkset handle from a link module descriptor
kabr - Fri Mar 08 04:00:37 EST 2013

Mathias Mamsch - Thu Mar 07 13:17:31 EST 2013
Yes. From the LinkModuleDescriptor find the link module and open it. Iterate through the linksets until you find the one with the source and target of the LinkModuleDescriptor. Note that you might not always find one, since you can have a linkModuleDescriptor without a linkset existing for it, even without the modules existing.

So no there is no function, that will do it for you. Why would you even need that? Test if a linkset exists for a linkmodule descritor? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

I have a dialog box that shows the LMDs listed in a module's properties, and a user can select the LMDs he wants to delete.
I was wondering if I could delete the related linksets and links as well from this dialog box.

Karl

Re: getting a linkset handle from a link module descriptor
llandale - Fri Mar 08 13:27:55 EST 2013

kabr - Fri Mar 08 04:00:37 EST 2013
I have a dialog box that shows the LMDs listed in a module's properties, and a user can select the LMDs he wants to delete.
I was wondering if I could delete the related linksets and links as well from this dialog box.

Karl

Deleting the LMD means the module is no longer has the contraints (or benefits) from the LMD; it has nothing to do with LinkSets or Links. If you are assigned a parking spot at work and we de-assign it, then you still have a car and the spot still exists. The "assignment" is just a piece of information, neither a car nor a spot.

A MM said, you can take the Source/Destin/LinkMod full name information in the LMD, open the LM edit, and find the LinkSet. If you delete the LinkSet then all the "Links" end up being deleted (but I'm not sure how).

Let me scribble; find the commands and attr names yourself:

NameLM = module(lmd)
NameSource = source(lmd)
NameTarget = target(lmd)
mCurr = current    // Remember original current Module
Module mLM = edit(NameLM, false, true, true)  // Open Link Module
if (null mLM) then No Such LM
mLM = current
for o in mLM do
{  LsSource = o."Source Something"
   Lstarget = o."Target Something"
   if (LsSource == NameSource and
       LsTarget == NameTarget)
   {       // Found LinkSet
      LinkSet ls = linkset(o)
      delete(ls)
      flushDeletions()
      save(mLM)
   }
}
close(mLM)
current = mCurr    // reinstate Current Module


-Louie

Re: getting a linkset handle from a link module descriptor
kabr - Mon Mar 11 08:41:09 EDT 2013

Thank you, Mathias and Louie,

I am aware of the difference between LMD and linkset and all its aspects and implications.
But I like your analogy, Louie. Maybe I will use it next time I try to explain the difference to one of my users.

With your suggestions I am able to do what I want.
Thanks again.

Karl